package com.ly.controller;

import com.ly.feign.ProductFeign;
import com.ly.pojo.Products;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/page")
public class PageController {
    @Autowired
    private ProductFeign productFeign;

    @RequestMapping("/queryById/{id}")
    public Products queryById(@PathVariable("id") Integer id){
        return productFeign.findProductionById(id);
    }

    @RequestMapping("/queryAllProducts")
    public List<Products> queryAllProducts(){
        return productFeign.findAllProduction();
    }

    @RequestMapping("/getPort")
    public String getPort(){
        return productFeign.getPort();
    }
}
